<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <!--<meta name="viewport"-->
    <!--content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>-->
    <link rel="stylesheet" type="text/css" href="/static/css/bootstrap.css"/>
    <link rel="stylesheet" href="/static/css/bodymain.css">
    <link rel="stylesheet" href="/static/css/home.css">
    <title>百知课程后台管理系统-首页
    </title>
    <style>
        .table-bordered > thead > tr > th, .table > tbody > tr > td {
            vertical-align: middle;
            text-align: center;
        }
    </style>
</head>
<body>
<!--导航-->
<nav class="navbar navbar-default nav-self">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="#">百知课程后台管理系统</a>
        </div>
        <div class="collapse navbar-collapse">
            <ul class="nav navbar-nav navbar-right">
                <li>
                    <a href="../user/login.html" role="button">登录 <span class="glyphicon glyphicon-log-in"></span></a>
                </li>
                <li>
                    <a href="../user/logout.html">退出 <span class="glyphicon glyphicon-log-out"></span></a>
                </li>
            </ul>
            <form class="navbar-form navbar-right">
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="">
                </div>
                <div class="btn-group" role="group" aria-label="...">
                    <div class="btn-group" role="group">
                        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"
                                aria-haspopup="true" aria-expanded="false">
                            <span class="glyphicon glyphicon-search"></span>
                        </button>
                    </div>
                </div>
            </form>

        </div>
    </div>
</nav>
<!--内容面板-->
<div class="container-fluid">
    <div class="row">
        <!-- Nav tabs -->
        <div class="panel-group col-sm-2 left-side-bar" id="accordion" role="tablist" aria-multiselectable="true">
            <div>
                <div class="panel panel-default">
                    <div class="panel-heading left-side-header">百知课程</div>
                    {% for cate in cate_list %}
                        <div class="course-python"><a
                                href="{% url 'course:article_list' %}?level=1&id={{ cate.id }}">{{ cate.title }}</a>
                        </div>
                        <div class="list-group">
                            {% for sub_cate in sub_cate_list %}
                                {% if sub_cate.parent_id == cate.id %}
                                    <a href="{% url 'course:article_list' %}?level=2&id={{ sub_cate.id }}"
                                       class="list-group-item">{{ sub_cate.title }}</a>
                                {% endif %}
                            {% endfor %}
                        </div>
                    {% endfor %}

                </div>
            </div>
        </div>
        <!-- Tab panes 详情展示面板 -->
        <div class="tab-content col-sm-10 right-side">

            <div class="panel panel-default right-side-content">
                <ol class="breadcrumb">
                    当前位置：
                    <li><a href="/">百知课程</a></li>

                    {% if level == '1' %}
                        <li>{{ title }}</li>
                    {% else %}
                        <li><a href="{% url 'course:article_list' %}?level=1&id={{ parent.id }}">{{ parent.title }}</a>
                        </li>
                        <li>{{ title }}</li>
                    {% endif %}
                </ol>
                <div class="panel-body caret_parent">
                    <a href="#" class="btn btn-default">阅读量 <span class="glyphicon glyphicon-arrow-down"></span></a>
                    <a href="#" class="btn btn-default">发布时间 <span class="glyphicon glyphicon-arrow-down"></span></a>
                    <a href="{% url 'course:add_article' %}" class="btn pull-right base-color add-course"><span
                            class="glyphicon glyphicon-plus"></span> 增加文章</a>
                    <a href="{% url 'course:add_course' %}" class="btn pull-right base-color"><span
                            class="glyphicon glyphicon-plus"></span> 增加课程/分类</a>
                </div>
                <div class="panel-heading">文章列表</div>
                <table class="table table-bordered table-striped table-hover">
                    <thead>
                    <tr>
                        <th><input type="checkbox"/></th>
                        <th>ID</th>
                        <th>文章标题</th>
                        <th>阅读量</th>
                        <th>所属课程</th>
                        <th>发布日期</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for art in page %}
                        <tr>
                            <td><input type="checkbox" class="checks"/></td>
                            <td>{{ art.id }}</td>
                            <td>
                                <a href="{% url 'course:update_article' %}?id={{ art.id }}">{{ art.title }}</a>
                            </td>
                            <td>
                                {{ art.page_views }}
                            </td>
                            <td>{{ art.cate.title }}</td>
                            <td>
                                {{ art.publish_time|date:'Y年m月d日 H:i:s' }}
                            </td>
                            <td>
                                <a class="btn btn-warning" href="{% url 'course:delete_article' %}?id={{ art.id }}&from={% url 'course:article_list' %}&level={{ level }}&cate_id={{ id }}">删除</a>
                            </td>
                        </tr>
                    {% endfor %}

                    </tbody>
                </table>
                <nav aria-label="Page navigation" class="pull-right pagitor-manager">
                    <ul class="pagination">
                        {% if page.has_previous %}
                            <li>
                                <a href="{% url 'course:article_list' %}?number={{ page.previous_page_number }}&level={{ level }}&id={{ id }}"
                                   aria-label="Previous">
                                    <span aria-hidden="true">&laquo;</span>
                                </a>
                            </li>
                        {% endif %}
                        {% for n in page.paginator.page_range %}
                            <li>
                                <a href="{% url 'course:article_list' %}?number={{ n }}&level={{ level }}&id={{ id }}">{{ n }}</a>
                            </li>
                        {% endfor %}

                        {% if page.has_next %}
                            <li>
                                <a href="{% url 'course:article_list' %}?number={{ page.next_page_number }}&level={{ level }}&id={{ id }}"
                                   aria-label="Next">
                                    <span aria-hidden="true">&raquo;</span>
                                </a>
                            </li>
                        {% endif %}
                    </ul>
                </nav>
            </div>
            <!--分页显示-->
        </div>

    </div>

</div>
<div class="footer">
    <div class="container">
        <div class="row">
            <div class="col-sm-4">
                <div class="thumbnail">
                    <div class="caption">
                        <h4><span class="glyphicon glyphicon-heart-empty glyphicon"></span> 关注我们</h4>
                        <p>最受欢迎的管理平台</p>
                        <p><a href="#" class="ic_df"> 新浪微博</a></p>
                        <p><a href="#" class="ic_weichat"> 官方微信</a></p>
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="thumbnail">
                    <div class="caption">
                        <h4><span class="glyphicon glyphicon-king"> 开发平台</span></h4>
                        <p>加入开发平台，尊享会员福利，成为资深程序猿</p>
                        <p class="p_idea"><a href="http://www.baizhibest.com"
                                             class="btn btn-default btn-lg idea">我要开发</a></p>
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="thumbnail">
                    <div class="caption">
                        <h4><span class="glyphicon glyphicon-phone-alt"></span> 关于我们</h4>
                        <p>欢迎反馈宝贵意见</p>
                        <p class="p_idea"><a href="http://www.baizhibest.com"
                                             class="btn btn-default btn-lg idea">意见反馈</a></p>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12 cp_info">
                <div class="no-mp">
                    <p>CopyRight © 2020 北京百知教育科技有限公司 All Rights Reserved</p>
                    <p>电话：010-****888 京ICP备*******8号</p>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="/static/js/jquery.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/js/bootstrap.js" type="text/javascript" charset="utf-8"></script>

</body>
</html>
